package spec.tianjunxiu.unit2.task2_3;

import java.util.Scanner;

        import java.util.Scanner;

public class RentCalculation {
    public double calculateTotalRent(){
        double totalRent=0;
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入月租金：");
        double monthRent=sc.nextDouble();
        System.out.println("请输入租房时间（以月为单位）：");
        int month=sc.nextInt();
        System.out.println("请输入物业费用：");
        double propertyCost=sc.nextDouble();
        System.out.println("请输入其他费用：");
        double otherCost=sc.nextDouble();
        totalRent+=monthRent*month;
        totalRent+=propertyCost*month;
        totalRent+=otherCost;
        return totalRent;
    }
    public double averageRent(double totalRent){
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入合租人数：");
        int numbers=sc.nextInt();
        return totalRent/numbers;
    }
}
